<?php

namespace app\backend\validate;

use app\common\RootValidate;

class TaskValidate extends RootValidate
{
    protected $rule = [
        'id' => 'require',
        'type' => 'require',
        'cycle' => 'require',
        'state' => 'require',
        'quantity' => 'require',
        'zhTitle' => 'require',
        'title' => 'require',
        'zhSubtitle' => 'require',
        'subtitle' => 'require',
        'zhButton' => 'require',
        'button' => 'require',
    ];

    protected $message = [
        'id.require' => '无效的任务',
        'type.require' => '请选择任务类型',
        'cycle.require' => '请选择任务周期',
        'state.require' => '请选择任务状态',
        'quantity.require' => '请填写任务数量',
        'zhTitle.require' => '请输入中文大标题',
        'title.require' => '请输入翻译大标题',
        'zhSubtitle.require' => '请输入中文小标题',
        'subtitle.require' => '请输入翻译小标题',
        'zhButton.require' => '请输入中文按钮',
        'button.require' => '请输入翻译按钮',
    ];

    protected $scene = [
        'add' => ['type', 'cycle', 'state', 'quantity', 'zhTitle', 'title', 'zhSubtitle', 'subtitle', 'zhButton', 'button'],
        'edit' => ['id', 'type', 'cycle', 'state', 'quantity', 'zhTitle', 'title', 'zhSubtitle', 'subtitle', 'zhButton', 'button'],
    ];
}